package proto

import (
	"regexp"
	D "websocket_apn/define"
	"websocket_apn/log"
)

// 西游伏魔处理装备
func ParaXIYOUUnDealEquipmentRsp(dataBytes []byte) D.EquipmentInfo {
	info := D.EquipmentInfo{
		DealFlag: true,
	}
	if len(dataBytes) < 15 {
		info.DealFlag = false
		return info
	}
	info.Data2A = make(map[int]D.EquipmentData, 0)
	info.Data12 = make(map[int]D.EquipmentData, 0)
	data := BytesToHexStr(dataBytes)
	//                                                                    1 装备的ID号             2 装备部位          3 装备等级              4 装备品级                    5 2A装备数据                                                    6 12装备数据                                               7 妖力值
	re := regexp.MustCompile(`12(?:[0-9A-F]{2}){1,3}0A[0-9A-F]{2}08((?:[0-9A-F]{2}){1,4})10([0-9A-F]{4})18((?:[0-9A-F]{2}){1,2})20((?:[0-9A-F]{2}){1,2})((?:2A[0-9A-F]{2}08[0-9A-F]{2}12[0-9A-F]{2}(?:3[0-9])+)+)((?:12[0-9A-F]{2}08[0-9A-F]{2}12[0-9A-F]{2}(?:3[0-9])+)*)12[0-9A-F]{2}((?:3[0-9])+)`) //1A[0-9A-F]{2}38((?:3[0-9])+)
	res := re.FindAllStringSubmatch(data, -1)
	if len(res) == 0 {
		log.Errorf("解析数据失败-%s", data)
	}
	for _, regRes := range res {
		info.Id = regRes[1] //装备的ID号
		part, _ := HexStrToBytes(regRes[2])
		info.Part = part                                //装备部位
		info.Level = ParaIntDataByHexStr(regRes[3])     //装备等级
		info.Grade = OneByteHexStrToByte(regRes[4])     //装备品级
		ParaEquipmentAttrData(regRes[5], &info)         //2A装备数据
		ParaEquipmentAttrData(regRes[6], &info)         //12装备数据
		info.CombatValue = HexDataStrToInt64(regRes[7]) //妖力
		//log.Debugf("%#v", regRes[1:])
		//log.Infof(" %s", GetEquipmentInfoDesc(info))
		break
	}
	return info
}

// 西游伏魔-当前装备属性
func ParaXIYOUCurrentEquipmentInfo(dataBytes []byte) int64 {
	if len(dataBytes) < 7 {
		return 0
	}
	data := BytesToHexStr(dataBytes)
	//当前角色属性                                    1 属性类型                2 属性值
	re0 := regexp.MustCompile(`1A[0-9A-F]{2}((?:3[0-9])+)`)
	res0 := re0.FindAllStringSubmatch(data, -1)
	if len(res0) == 0 {
		log.Errorf("解析数据失败-%s", data)
	}
	for _, regRes := range res0 {
		return HexDataStrToInt64(regRes[1])
	}
	return 0
}

// 西游伏魔-当前人物属性
func ParaXIYOUPlayerInfo(dataBytes []byte) D.XIYOUPlayerInfo {
	info := D.XIYOUPlayerInfo{}
	if len(dataBytes) < 7 {
		return info
	}
	data := BytesToHexStr(dataBytes)
	//当前角色属性                                    1 妖力        2 当前关卡
	re0 := regexp.MustCompile(`1A[0-9A-F]{2}((?:3[0-9])+)20((?:[0-9A-F]{2}){1,3})2A`)
	res0 := re0.FindAllStringSubmatch(data, -1)
	if len(res0) == 0 {
		log.Errorf("解析数据失败-%s", data)
	}
	for _, regRes := range res0 {
		info.CombatValue = HexDataStrToInt64(regRes[1])
		info.Passes = ParaIntDataByHexStr(regRes[2])
		info.PassesStr = regRes[2]
		break
	}
	//                                            1 道运等级        2 升级时间
	re1 := regexp.MustCompile(`2A[0-9A-F]{2}08([0-9A-F]{2})10(00|[0-9A-F]{12})18`)
	res1 := re1.FindAllStringSubmatch(data, -1)
	if len(res1) == 0 {
		log.Errorf("解析数据失败-%s", data)
	}
	for _, regRes := range res1 {
		info.Level = OneByteHexStrToByte(regRes[1])
		if len(regRes[2]) == 12 {
			info.Updating = true
		}
		info.UpdateTime = ParaHexStrToTimeMs(regRes[2])
		break
	}

	return info
}

/*
	t.Logf("%+v", ParaIntDataByHexStr("D9F93D")) //1015002
	t.Logf("%+v", ParaIntDataByHexStr("DAF93D")) //1015002
	t.Logf("%+v", ParaIntDataByHexStr("DBF93D")) //1015003
	t.Logf("%+v", ParaIntDataByHexStr("DCF93D")) //1015004
	t.Logf("%+v", ParaIntDataByHexStr("DDF93D")) //1015005
	t.Logf("%+v", ParaIntDataByHexStr("9975"))   //15001 零星妖宗
	t.Logf("%+v", ParaIntDataByHexStr("9A75"))   //15002 妖聚成患
	t.Logf("%+v", ParaIntDataByHexStr("9B75"))   //15003 群妖盘踞
	t.Logf("%+v", ParaIntDataByHexStr("9C75"))   //15004 1
	t.Logf("%+v", ParaIntDataByHexStr("9D75"))   //15005 大妖劫难

[DEBUG] [2025/08/15 21:40:44] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_START - len:27
[DEBUG] [2025/08/15 21:40:44] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1B 00 03 86 D7 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 0F 18 01
[DEBUG] [2025/08/15 21:40:44] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_START_RSP - len:43
[DEBUG] [2025/08/15 21:40:44] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 2B 00 00 79 97 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 36 18 0F 20 DC F9 3D 20 99 75 28 DA F9 3D
[DEBUG] [2025/08/15 21:42:13] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:31
[DEBUG] [2025/08/15 21:42:13] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1F 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 0F 18 01 20 DC F9 3D
[DEBUG] [2025/08/15 21:42:13] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:47
[DEBUG] [2025/08/15 21:42:13] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 2F 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 38 18 0F 20 DD F9 3D 20 9A 75 28 DA F9 3D 28 DC F9 3D
[DEBUG] [2025/08/15 21:44:50] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:30
[DEBUG] [2025/08/15 21:44:50] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1E 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 0F 18 01 20 9A 75
[DEBUG] [2025/08/15 21:44:50] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:49
[DEBUG] [2025/08/15 21:44:50] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 31 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 35 18 0F 20 9B 75 20 99 75 28 DA F9 3D 28 DC F9 3D 28 9A 75
[DEBUG] [2025/08/15 21:48:48] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:30
[DEBUG] [2025/08/15 21:48:48] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1E 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 0F 18 01 20 9B 75
[DEBUG] [2025/08/15 21:48:48] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:51
[DEBUG] [2025/08/15 21:48:48] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 33 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 36 18 0F 20 CF 8D B7 01 28 DA F9 3D 28 DC F9 3D 28 9A 75 28 9B 75
[DEBUG] [2025/08/15 21:49:17] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_KILL - len:27
[DEBUG] [2025/08/15 21:49:17] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1B 00 03 86 D9 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 0F 18 01
[DEBUG] [2025/08/15 21:49:17] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_BAG_DATA_SYNC_MSG_RSP - len:37
[DEBUG] [2025/08/15 21:49:17] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 25 00 00 01 2D 00 00 02 D4 07 01 81 E2 0A 07 08 C6 B6 06 12 01 38 0A 08 08 DF B6 06 12 02 33 34
[DEBUG] [2025/08/15 21:49:17] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_KILL_RSP - len:87
[DEBUG] [2025/08/15 21:49:17] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 57 00 00 79 99 00 00 02 D4 07 01 81 E2 08 00 12 09 31 30 35 33 31 31 3D 32 35 18 10 2A 34 0A 29 08 20 10 07 18 95 A8 41 20 0F 28 06 30 01 3A 06 08 27 12 02 31 34 3A 0D 08 08 12 09 31 34 2E 37 32 30 30 30 30 40 00 48 00 12 07 31 33 38 37 34 38 31

[DEBUG] [2025/08/15 21:50:50] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_START - len:27
[DEBUG] [2025/08/15 21:50:50] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1B 00 03 86 D7 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 10 18 01
[DEBUG] [2025/08/15 21:50:50] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_START_RSP - len:42
[DEBUG] [2025/08/15 21:50:50] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 2A 00 00 79 97 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 37 18 10 20 85 7D 20 82 7D 28 C3 81 3E
[DEBUG] [2025/08/15 21:53:26] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:30
[DEBUG] [2025/08/15 21:53:26] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1E 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 10 18 01 20 82 7D
[DEBUG] [2025/08/15 21:53:26] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:47
[DEBUG] [2025/08/15 21:53:26] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 2F 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 35 18 10 20 C5 81 3E 20 C1 81 3E 28 C3 81 3E 28 82 7D
[DEBUG] [2025/08/15 21:54:19] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:31
[DEBUG] [2025/08/15 21:54:19] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1F 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 10 18 01 20 C1 81 3E
[DEBUG] [2025/08/15 21:54:19] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:50
[DEBUG] [2025/08/15 21:54:19] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 32 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 35 18 10 20 82 7D 20 C4 81 3E 28 C3 81 3E 28 82 7D 28 C1 81 3E
[DEBUG] [2025/08/15 21:55:19] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:30
[DEBUG] [2025/08/15 21:55:19] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1E 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 10 18 01 20 82 7D
[DEBUG] [2025/08/15 21:55:19] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:54
[DEBUG] [2025/08/15 21:55:19] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 36 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 35 18 10 20 C3 81 3E 20 C4 81 3E 28 C3 81 3E 28 82 7D 28 C1 81 3E 28 82 7D
[DEBUG] [2025/08/15 21:55:54] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:31
[DEBUG] [2025/08/15 21:55:54] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1F 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 10 18 01 20 C3 81 3E
[DEBUG] [2025/08/15 21:55:54] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:54
[DEBUG] [2025/08/15 21:55:54] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 36 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 35 18 10 20 90 89 7A 28 C3 81 3E 28 82 7D 28 C1 81 3E 28 82 7D 28 C3 81 3E
[DEBUG] [2025/08/15 21:55:57] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_WAR_SEASON_SYNC_SEND_GIFT_RSP - len:46
[DEBUG] [2025/08/15 21:55:57] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 2E 00 00 44 8B 00 00 02 D4 07 01 81 E2 0A 1A 0A 07 E9 9C 9E F0 9F 8C B8 10 B6 96 09 18 53 20 FE 94 90 F0 8A 33 28 D8 B5 06
[DEBUG] [2025/08/15 21:56:26] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_KILL - len:27
[DEBUG] [2025/08/15 21:56:26] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1B 00 03 86 D9 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 10 18 01
[DEBUG] [2025/08/15 21:56:26] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_BAG_DATA_SYNC_MSG_RSP - len:37
[DEBUG] [2025/08/15 21:56:26] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 25 00 00 01 2D 00 00 02 D4 07 01 81 E2 0A 07 08 C6 B6 06 12 01 37 0A 08 08 DF B6 06 12 02 36 31
[DEBUG] [2025/08/15 21:56:26] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_KILL_RSP - len:149
[DEBUG] [2025/08/15 21:56:26] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 95 00 00 79 99 00 00 02 D4 07 01 81 E2 08 00 12 09 31 30 35 33 31 31 3D 32 37 18 11 2A 34 0A 29 08 21 10 08 18 A5 F6 41 20 10 28 06 30 01 3A 06 08 1B 12 02 31 37 3A 0D 08 08 12 09 31 34 2E 39 35 30 30 30 30 40 00 48 00 12 07 31 33 38 39 35 39 34 2A 3C 0A 31 08 22 10 05 18 D9 8C 40 20 10 28 06 30 02 3A 06 08 0E 12 02 34 37 3A 06 08 14 12 02 31 38 3A 0D 08 07 12 09 32 39 2E 39 30 30 30 30 30 40 00 48 00 12 07 31 34 32 30 38 37 35

[DEBUG] [2025/08/15 22:06:17] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_START - len:27
[DEBUG] [2025/08/15 22:06:17] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1B 00 03 86 D7 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 11 18 01
[DEBUG] [2025/08/15 22:06:17] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_START_RSP - len:44
[DEBUG] [2025/08/15 22:06:17] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 2C 00 00 79 97 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 34 18 11 20 AC 89 3E 20 EB 84 01 28 A9 89 3E
[DEBUG] [2025/08/15 22:06:41] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:31
[DEBUG] [2025/08/15 22:06:41] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1F 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 11 18 01 20 EB 84 01
[DEBUG] [2025/08/15 22:06:41] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:48
[DEBUG] [2025/08/15 22:06:41] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 30 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 37 18 11 20 AA 89 3E 20 ED 84 01 28 A9 89 3E 28 EB 84 01
[DEBUG] [2025/08/15 22:07:11] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:31
[DEBUG] [2025/08/15 22:07:11] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1F 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 11 18 01 20 AA 89 3E
[DEBUG] [2025/08/15 22:07:11] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:52
[DEBUG] [2025/08/15 22:07:11] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 34 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 36 18 11 20 ED 84 01 20 E9 84 01 28 A9 89 3E 28 EB 84 01 28 AA 89 3E
DEBUG] [2025/08/15 22:07:37] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:31
[DEBUG] [2025/08/15 22:07:37] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1F 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 11 18 01 20 E9 84 01
[DEBUG] [2025/08/15 22:07:37] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:56
[DEBUG] [2025/08/15 22:07:37] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 38 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 35 18 11 20 EC 84 01 20 EB 84 01 28 A9 89 3E 28 EB 84 01 28 AA 89 3E 28 E9 84 01
[DEBUG] [2025/08/15 22:08:03] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_SELECT - len:31
[DEBUG] [2025/08/15 22:08:03] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1F 00 03 86 D8 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 11 18 01 20 EB 84 01
[DEBUG] [2025/08/15 22:08:03] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_SELECT_RSP - len:54
[DEBUG] [2025/08/15 22:08:03] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 36 00 00 79 98 00 00 02 D4 07 01 81 E2 08 00 12 08 31 30 35 33 31 31 3D 35 18 11 20 11 28 A9 89 3E 28 EB 84 01 28 AA 89 3E 28 E9 84 01 28 EB 84 01
[DEBUG] [2025/08/15 22:08:36] [PRJ/websocket_apn/main_test.go]:[  150]:   ↑↑↑↑↑ S_XIYOU_SECRET_KILL - len:27
[DEBUG] [2025/08/15 22:08:36] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 1B 00 03 86 D9 00 00 02 D4 07 01 81 E2 08 B1 FE A0 05 10 11 18 01
[DEBUG] [2025/08/15 22:08:36] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_BAG_DATA_SYNC_MSG_RSP - len:37
[DEBUG] [2025/08/15 22:08:36] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 25 00 00 01 2D 00 00 02 D4 07 01 81 E2 0A 07 08 C6 B6 06 12 01 36 0A 08 08 DF B6 06 12 02 38 38
[DEBUG] [2025/08/15 22:08:36] [PRJ/websocket_apn/main_test.go]:[  152]:   ↓↓↓↓↓ S_XIYOU_SECRET_KILL_RSP - len:95
[DEBUG] [2025/08/15 22:08:36] [PRJ/websocket_apn/main_test.go]:[  157]:   PayloadBytes: 71 AB 00 00 00 5F 00 00 79 99 00 00 02 D4 07 01 81 E2 08 00 12 09 31 30 35 33 31 31 3D 32 37 18 12 2A 3C 0A 31 08 23 10 04 18 C9 BE 3F 20 11 28 06 30 02 3A 0D 08 09 12 09 33 30 2E 33 36 30 30 30 30 3A 06 08 25 12 02 31 38 3A 06 08 26 12 02 32 31 40 00 48 00 12 07 31 34 30 36 32 34 37
*/
func ParaXIYOUSecretInfo(dataBytes []byte) D.XIYOUSecretInfo {
	info := D.XIYOUSecretInfo{}
	data := BytesToHexStr(dataBytes)
	//当前角色属性                         1 当前关卡           2     3
	re0 := regexp.MustCompile(`18([0-9A-F]{2})20((?:[0-9A-F]{2}){1,4})(?:20((?:[0-9A-F]{2}){1,3}))?28`)
	res0 := re0.FindAllStringSubmatch(data, -1)
	if len(res0) == 0 {
		log.Errorf("解析数据失败-%s", data)
	}
	//log.Debugf("%d %+v", len(res0[0]), res0[0])
	for _, regRes := range res0 {
		info.Level = OneByteHexStrToByte(regRes[1])
		info.ID = append(info.ID, regRes[2])
		if len(res0[0]) > 3 && len(regRes[3]) > 0 {
			info.ID = append(info.ID, regRes[3])
		}
		break
	}

	return info
}

func ParaXIYOUSecretKillInfo(dataBytes []byte) int {
	data := BytesToHexStr(dataBytes)
	//当前角色属性                         1 当前关卡
	re0 := regexp.MustCompile(`20([0-9A-F]{2})28(?:[0-9A-F]{2}){1,2}30`)
	res0 := re0.FindAllStringSubmatch(data, -1)
	if len(res0) == 0 {
		log.Errorf("解析数据失败-%s", data)
	}
	log.Debugf("%+v", res0)
	for _, regRes := range res0 {
		return int(OneByteHexStrToByte(regRes[1]))
	}

	return 0
}
